// applyMiddleware是用于解决异步的函数
import { legacy_createStore, applyMiddleware } from "redux";

import reducer from "./reducer";

// redux-thunk是一个异步库，用于配合applyMiddleware实现异步
import thunk from "redux-thunk";

// createStore函数还可以接受第二个参数，是applyMiddleware的返回值
const store = legacy_createStore(reducer, applyMiddleware(thunk));

export default store;
